const state = {
    menus: [],
    permission: [],
}

const actions = {
    async _setMenu ({commit}, {menu, permission}) {
        commit('@menu/setMenu', menu)
        commit('@menu/setPermission', permission)
    },
}

const mutations = {
    '@menu/setMenu' (state, menu) {
        state.menus = menu
    },
    '@menu/setPermission' (state, permission) {
        state.permission = permission
    },
}

export default {
    state,
    mutations,
    actions,
}
